﻿Public Class EnvironmentSupport
    Private Shared WINDOWS_7_VERSION As Version
    Private Shared os As OperatingSystem = Nothing

    Shared Sub New()
        WINDOWS_7_VERSION = New Version(6, 1)
        os = Environment.OSVersion
    End Sub


    Public Shared Function MeetsOrExceeds(ByVal platformVersion As PlatformVersion) As Boolean
        If os.Platform <> platformVersion.PlatformID OrElse os.Version < platformVersion.Version Then
            Return False
        Else
            Return True
        End If
    End Function
End Class

Public Class PlatformVersion
    Public Shared WINDOWS_7 As New PlatformVersion(PlatformID.Win32NT, New Version(6, 1))

    Private m_Version As Version
    Private m_PlatformID As PlatformID

    Public Property Version() As Version
        Get
            Return m_Version
        End Get
        Private Set(ByVal value As Version)
            m_Version = value
        End Set
    End Property

    Public Property PlatformID() As PlatformID
        Get
            Return m_PlatformID
        End Get
        Private Set(ByVal value As PlatformID)
            m_PlatformID = value
        End Set
    End Property

    Public Sub New(ByVal platform As PlatformID, ByVal version As Version)
        Me.PlatformID = platform
        Me.Version = version
    End Sub
End Class
